package sadi.util;

import java.rmi.*;
import java.util.*;

public interface WikiServer extends Remote
{
	/*************** USER HANDLING METHODS ***************/
	
	//Get Introduction Message
	public String getIntroduction() throws RemoteException;
	
	//Set Introduction Message
	public boolean setIntroduction(String message, int userID) throws RemoteException;
	
	
	
	/*************** USER HANDLING METHODS ***************/
	
	//Login A User
	//Success: Return UserID
	//Failure: Return -1
	public int loginUser(String username, String password) throws RemoteException;
	
	//Register A User
	//Username Must Be Unique
	public boolean registerUser(String username, String password) throws RemoteException;
	
	//Check User's Administrative Rights
	public boolean isAdmin(int userID) throws RemoteException;
	
	
	
	/*************** WIKI LISTING HANDLING METHODS ***************/
	
	//Search Wiki Matches
	public ArrayList<ArrayList<String>> searchWiki(String title) throws RemoteException;
	
	//Get Latest Wiki Highlights
	public ArrayList<ArrayList<String>> getHighlightList() throws RemoteException;
	
	//Get List of Wiki with the Specified Status
	public ArrayList<ArrayList<String>> getApprovalList(int userID) throws RemoteException;
	
	//Get List of Wiki with the Specified Status
	public ArrayList<ArrayList<String>> getReportedList(int userID) throws RemoteException;
	
	
	
	/*************** WIKI HANDLING METHODS ***************/
	
	//View Content of Wiki
	public ArrayList<String> viewWiki(int wikiID, int userID) throws RemoteException;
	
	//Create a New Wiki With Content
	public boolean addWiki(String title, String description, String content, int userID) throws RemoteException;
	
	//Edit Wiki Contents
	public boolean editWiki(int wikiID, String title, String description, String content, int userID) throws RemoteException;
	
	//Delete Wiki
	public boolean deleteWiki(int wikiID, int userID) throws RemoteException;
	
	//Report Wiki Contents
	public boolean addReport(int wikiID, int userID) throws RemoteException;
	
	//Approve Wiki Contents
	public boolean approveWiki(int wikiID, int userID) throws RemoteException;
}
